import request from '@/utils/request'
//用户退单-------------------------------------
//退货订单列表
export function returnListData(query) {
  return request({
    url: '/data/user/productReturn/order/',
    method: 'get',
    params: query
  })
}


//审核退货单
export function returnCheck(data) {
  return request({
    url: '/data/user/productReturn/order/auditReturnOrder',
    method: 'POST',
    data: data
  })
}

//退货日志
export function returnLog(query) {
  return request({
    url: '/data/user/productReturn/orderLog/',
    method: 'get',
    params: query
  })
}


//退货详情
export function returnDetail(id) {
  return request({
    url: '/data/user/product/returnOrderDetail/' + id,
    method: 'get',
  })
}

//确认退款
export function returnConfirm (data) {
  return request({
    url: '/data/user/productReturn/order/confirmRefund',
    method: 'POST',
    params: data
  })
}

//删除
export function returnDelete (id) {
  return request({
    url: '/data/user/productReturn/order/' + id,
    method: 'DELETE'
  })
}

//创建退货单（用于测试）
export function createReturnOrder (data) {
  return request({
    url: '/api/data/user/order/apply/depositRefund',
    method: 'POST',
    params: data
  })
}


//新的接口------------------------------
//仓库转单
export function changeOrder (data) {
  return request({
    url: '/data/user/productReturn/order/shiftOrder',
    method: 'POST',
    params: data
  })
}
//仓库分配订单
export function assignOrder(data) {
  return request({
    url: '/data/user/productReturn/order/allocationOrder',
    method: 'POST',
    params: data
  })
}
//确认转单
export function confirmChange(data) {
  return request({
    url: '/data/user/productReturn/order/confirmShiftOrder',
    method: 'POST',
    params: data
  })
}
// 系统根据类型下拉用户配送员下拉
export function getSenderList(data) {
  return request({
    url: '/sys/user/pullDown',
    method: 'GET',
    query: data
  })
}
//配送员确定去回收
export function confirmSend(data) {
  return request({
    url: '/data/user/productReturn/order/confirm/allocationOrder',
    method: 'POST',
    params: data
  })
}
//配送员清点退货单
export function senderCheck(data) {
  return request({
    url: '/data/user/productReturn/order/auditReturnOrder',
    method: 'POST',
    data: data
  })
}
//仓管清点
export function manageCheck(data) {
  return request({
    url: '/data/user/productReturn/order/confirmRefund',
    method: 'POST',
    data: data
  })
}

//核销
export function chargeOff(data) {
  return request({
    url: '/data/user/productReturn/order/chargeOff',
    method: 'POST',
    params: data
  })
}

//查询退桶单列表
export function bucketList(query) {
  return request({
    url: '/data/user/productReturn/bucket/list',
    method: 'get',
    params: query
  })
}

//新增退桶单
export function addBucketOrder(data) {
  return request({
    url: '/data/user/productReturn/bucket/',
    method: 'put',
    params: data
  })
}
